import { request } from '@/utils/request'

//获取机构信息接口
export const getOrganizationInfo = () => request('/booking/getOrganizationInfo', 'GET')

//根据机构查询对应咨询师信息接口
export const getConsultantsByOrgid = (org_id) =>
  request('/booking/getConsultantsByOrdid', 'GET', { org_id })

//获取城市列表信息接口
export const getCities = () => request('/booking/getCities', 'GET')

//根据不同城市搜索对应咨询师信息接口
export const getConsultantsByCityid = (city_id) =>
  request('/booking/getConsultantsByCityid', 'GET', { city_id })

//获取咨询师擅长领域信息接口
export const getSpecialties = () => request('/booking/getSpecialties', 'GET')

//根据不同擅长领域搜素对应咨询师信息接口
export const getConsultantsBySpeciality = (spe_id) =>
  request('/booking/getConsultantsBySpeciality', 'GET', { spe_id })

//获取咨询师详情信息
export const getDetailConsultantInfo = (id) =>
  request('/booking/getDetailConsultantInfo', 'GET', { id })

//获取咨询师空闲时间信息接口
export const getavailableTime = (id) => request('/booking/getavailableTime', 'GET', { id })

export const getAvailableToday = (id, today) =>
  request('/booking/getAvailableToday', 'GET', { id, today })

//根据日期查询咨询师空闲信息接口
export const getAvailableByTime = (id, time) =>
  request('/booking/getAvailableByTime', 'GET', { id, time })

//用户预约接口
export const appointment = (formData) => request('/booking/appointment', 'POST', formData)

//获取用户全部预约信息接口
export const getAppointmentData = (user_id) =>
  request('/booking/getAppointmentData', 'GET', { user_id })

//获取用户预约状态为scheduled的信息接口
export const getScheduledData = (user_id) =>
  request('/booking/getScheduledData', 'GET', { user_id })

//获取用户预约状态为scheduled并且时间在今日以后得信息接口
export const getScheduledDataAfter = (user_id) =>
  request('/booking/getScheduledDataAfter', 'GET', { user_id })

//将用户预约状态为scheduled修改为completed的接口
export const updateScheduledIntoCompletd = (appointment_id) =>
  request('/booking/updateScheduledIntoCompletd', 'POST', { appointment_id })

//获取用户预约状态为取消的信息接口
export const getCancelledData = (user_id) =>
  request('/booking/getCancelledData', 'GET', { user_id })

//获取用户预约状态为已完成的信息接口
export const getCompletedData = (user_id) =>
  request('/booking/getCompletedData', 'GET', { user_id })

//用户取消预约接口
export const cancelBooking = (formData) => request('/booking/cancelBooking', 'POST', formData)
